import 'package:json_annotation/json_annotation.dart';

part 'order_model.g.dart';

@JsonSerializable()
class OrderModel extends Object {
  List<OrderItemModel>? filter_result;
  Filter? filter;
  int? total;
  int? errcode;
  String? message;

  OrderModel({
    this.filter_result,
    this.filter,
    this.total,
    this.errcode,
    this.message,
  });

  factory OrderModel.fromJson(Map<String, dynamic> srcJson) => _$OrderModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$OrderModelToJson(this);
}

@JsonSerializable()
class OrderItemModel extends Object {
  String? order_status_name;
  String? user_address;
  String? shipping_status_name;
  String? pay_status_name;
  int? order_id;
  String? order_sn;
  int? user_id;
  int? parent_order_id;
  String? parent_order_sn;
  int? order_status;
  int? shipping_status;
  int? pay_status;
  String? add_time;
  String? consignee;
  String? address;
  List<int>? region_ids;
  List<String>? region_names;
  Address_data? address_data;
  String? mobile;
  String? email;
  String? buyer_note;
  String? admin_note;
  int? shipping_method;
  int? logistics_id;
  String? logistics_name;
  int? shipping_type_id;
  String? shipping_type_name;
  String? tracking_no;
  String? shipping_time;
  String? received_time;
  int? pay_type_id;
  String? pay_time;
  int? use_points;
  int? is_need_commisson;
  int? distribution_status;
  int? referrer_user_id;
  int? is_del;
  int? shop_id;
  int? is_store_splited;
  int? comment_status;
  String? total_amount;
  String? paid_amount;
  String? unpaid_amount;
  String? unrefund_amount;
  String? product_amount;
  String? coupon_amount;
  String? points_amount;
  String? discount_amount;
  String? balance;
  String? online_paid_amount;
  String? offline_paid_amount;
  String? service_fee;
  String? shipping_fee;
  String? invoice_fee;
  Order_extension? order_extension;
  String? order_source;
  List<dynamic>? invoice_data;
  String? out_trade_no;
  int? is_settlement;
  int? is_exchange_order;
  int? order_type;
  int? shop_user_id;
  String? member_discount_amount;
  Available_actions? available_actions;
  int? shop_user_name;
  List<Items>? items;
  User? user;

  OrderItemModel({
    this.order_status_name,
    this.user_address,
    this.shipping_status_name,
    this.pay_status_name,
    this.order_id,
    this.order_sn,
    this.user_id,
    this.parent_order_id,
    this.parent_order_sn,
    this.order_status,
    this.shipping_status,
    this.pay_status,
    this.add_time,
    this.consignee,
    this.address,
    this.region_ids,
    this.region_names,
    this.address_data,
    this.mobile,
    this.email,
    this.buyer_note,
    this.admin_note,
    this.shipping_method,
    this.logistics_id,
    this.logistics_name,
    this.shipping_type_id,
    this.shipping_type_name,
    this.tracking_no,
    this.shipping_time,
    this.received_time,
    this.pay_type_id,
    this.pay_time,
    this.use_points,
    this.is_need_commisson,
    this.distribution_status,
    this.referrer_user_id,
    this.is_del,
    this.shop_id,
    this.is_store_splited,
    this.comment_status,
    this.total_amount,
    this.paid_amount,
    this.unpaid_amount,
    this.unrefund_amount,
    this.product_amount,
    this.coupon_amount,
    this.points_amount,
    this.discount_amount,
    this.balance,
    this.online_paid_amount,
    this.offline_paid_amount,
    this.service_fee,
    this.shipping_fee,
    this.invoice_fee,
    this.order_extension,
    this.order_source,
    this.invoice_data,
    this.out_trade_no,
    this.is_settlement,
    this.is_exchange_order,
    this.order_type,
    this.shop_user_id,
    this.member_discount_amount,
    this.available_actions,
    this.shop_user_name,
    this.items,
    this.user,
  });

  factory OrderItemModel.fromJson(Map<String, dynamic> srcJson) => _$OrderItemModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$OrderItemModelToJson(this);
}

@JsonSerializable()
class Address_data extends Object {
  int? address_id;
  String? address_tag;
  int? user_id;
  String? consignee;
  String? email;
  List<int>? region_ids;
  List<String>? region_names;
  String? address;
  String? postcode;
  String? telephone;
  String? mobile;
  int? is_default;
  int? is_selected;

  Address_data({
    this.address_id,
    this.address_tag,
    this.user_id,
    this.consignee,
    this.email,
    this.region_ids,
    this.region_names,
    this.address,
    this.postcode,
    this.telephone,
    this.mobile,
    this.is_default,
    this.is_selected,
  });

  factory Address_data.fromJson(Map<String, dynamic> srcJson) => _$Address_dataFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Address_dataToJson(this);
}

@JsonSerializable()
class Order_extension extends Object {
  Map<String, int>? coupon_amount;
  Map<String, int>? discount_amount;
  List<dynamic>? shipping_fee;
  List<Shipping_type>? shipping_type;

  Order_extension({
    this.coupon_amount,
    this.discount_amount,
    this.shipping_fee,
    this.shipping_type,
  });

  factory Order_extension.fromJson(Map<String, dynamic> srcJson) => _$Order_extensionFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Order_extensionToJson(this);
}

@JsonSerializable()
class Shipping_type extends Object {
  int? type_id;
  String? type_name;

  Shipping_type({
    this.type_id,
    this.type_name,
  });

  factory Shipping_type.fromJson(Map<String, dynamic> srcJson) => _$Shipping_typeFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Shipping_typeToJson(this);
}

@JsonSerializable()
class Available_actions extends Object {
  bool? set_confirm;
  bool? to_pay;
  bool? set_paid;
  bool? set_unpaid;
  bool? cancel_order;
  bool? del_order;
  bool? deliver;
  bool? confirm_receipt;
  bool? split_order;
  bool? modify_order;
  bool? rebuy;
  bool? modify_order_money;
  bool? modify_order_consignee;
  bool? modify_order_product;
  bool? modify_shipping_info;
  bool? to_aftersales;
  bool? to_comment;
  bool? to_write;

  Available_actions({
    this.set_confirm,
    this.to_pay,
    this.set_paid,
    this.set_unpaid,
    this.cancel_order,
    this.del_order,
    this.deliver,
    this.confirm_receipt,
    this.split_order,
    this.modify_order,
    this.rebuy,
    this.modify_order_money,
    this.modify_order_consignee,
    this.modify_order_product,
    this.modify_shipping_info,
    this.to_aftersales,
    this.to_comment,
    this.to_write,
  });

  factory Available_actions.fromJson(Map<String, dynamic> srcJson) => _$Available_actionsFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Available_actionsToJson(this);
}

@JsonSerializable()
class Items extends Object {
  int? item_id;
  int? order_id;
  String? order_sn;
  int? user_id;
  String? price;
  int? quantity;
  int? product_id;
  String? product_name;
  String? product_sn;
  String? pic_thumb;
  int? sku_id;
  List<Sku_data>? sku_data;
  int? delivery_quantity;
  int? product_type;
  int? is_gift;
  int? shop_id;
  int? is_pin;
  String? prepay_price;
  String? commission;
  String? origin_price;
  int? is_seckill;
  String? member_discount;
  String? product_pic_thumb;
  int? product_stock;
  String? product_weight;
  int? suppliers_id;
  String? virtual_sample;
  String? paid_content;
  int? card_group_id;
  int? sku_stock;
  String? sku_sn;
  String? sku_value;
  List<dynamic>? e_card;

  Items({
    this.item_id,
    this.order_id,
    this.order_sn,
    this.user_id,
    this.price,
    this.quantity,
    this.product_id,
    this.product_name,
    this.product_sn,
    this.pic_thumb,
    this.sku_id,
    this.sku_data,
    this.delivery_quantity,
    this.product_type,
    this.is_gift,
    this.shop_id,
    this.is_pin,
    this.prepay_price,
    this.commission,
    this.origin_price,
    this.is_seckill,
    this.member_discount,
    this.product_pic_thumb,
    this.product_stock,
    this.product_weight,
    this.suppliers_id,
    this.virtual_sample,
    this.paid_content,
    this.card_group_id,
    this.sku_stock,
    this.sku_sn,
    this.sku_value,
    this.e_card,
  });

  factory Items.fromJson(Map<String, dynamic> srcJson) => _$ItemsFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ItemsToJson(this);
}

@JsonSerializable()
class Sku_data extends Object {
  String? name;
  String? value;

  Sku_data({
    this.name,
    this.value,
  });

  factory Sku_data.fromJson(Map<String, dynamic> srcJson) => _$Sku_dataFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Sku_dataToJson(this);
}

@JsonSerializable()
class User extends Object {
  String? username;
  String? nickname;
  int? user_id;
  String? mobile;
  String? avatar;
  String? balance;
  int? points;

  User({
    this.username,
    this.nickname,
    this.user_id,
    this.mobile,
    this.avatar,
    this.balance,
    this.points,
  });

  factory User.fromJson(Map<String, dynamic> srcJson) => _$UserFromJson(srcJson);

  Map<String, dynamic> toJson() => _$UserToJson(this);
}

@JsonSerializable()
class Filter extends Object {
  String? keyword;
  int? order_status;
  int? pay_status;
  int? shipping_status;
  int? comment_status;
  int? date_type;
  int? page;
  int? size;
  String? sort_field;
  String? sort_order;
  int? user_id;

  Filter({
    this.keyword,
    this.order_status,
    this.pay_status,
    this.shipping_status,
    this.comment_status,
    this.date_type,
    this.page,
    this.size,
    this.sort_field,
    this.sort_order,
    this.user_id,
  });

  factory Filter.fromJson(Map<String, dynamic> srcJson) => _$FilterFromJson(srcJson);

  Map<String, dynamic> toJson() => _$FilterToJson(this);
}
